package com.example.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.io.Serializable;
import com.example.model.dto.BaseDTO;
import com.example.validator.group.AddGroup;
import com.example.validator.group.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.NoArgsConstructor;

@Data
@Schema(description = "代码生成表映射列属性配置")
@JsonIgnoreProperties(ignoreUnknown = true) // 标注 UserDetail 类以忽略未知属性
@NoArgsConstructor
public class GenTableFieldDTO extends BaseDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @Null(message = "{id.null}", groups = AddGroup.class)
    @NotNull(message = "{id.require}", groups = UpdateGroup.class)
    @Schema(description = "id")
    private Long id;

    @Schema(description = "表ID")
    private Long tableId;

    @Schema(description = "表名")
    private String tableName;

    @Schema(description = "列名")
    private String columnName;

    @Schema(description = "类型")
    private String columnType;

    @Schema(description = "列说明")
    private String columnComment;

    @Schema(description = "属性名")
    private String attrName;

    @Schema(description = "属性类型")
    private String attrType;

    @Schema(description = "属性包名")
    private String packageName;

    @Schema(description = "是否主键 0：否  1：是")
    private Integer isPk;

    @Schema(description = "是否必填 0：否  1：是")
    private Integer isRequired;

    @Schema(description = "是否表单字段 0：否  1：是")
    private Integer isForm;

    @Schema(description = "是否列表字段 0：否  1：是")
    private Integer isList;

    @Schema(description = "是否查询字段 0：否  1：是")
    private Integer isQuery;

    @Schema(description = "查询方式")
    private String queryType;

    @Schema(description = "表单类型")
    private String formType;

    @Schema(description = "字典名称")
    private String dictName;

    @Schema(description = "效验方式")
    private String validatorType;

    @Schema(description = "排序")
    private Integer sort;
}